package com.yupi.apiinvoksdk.config;

import com.yupi.apiinvoksdk.utils.ApiClient;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 创建调用客户端
 *
 * @author yanghaifeng
 * @date 2024/1/23 11:11
 */
@Data
@Configuration
// 此注解表示当该类进行加在的时候，会去applicaiton.yml配置文件中读取前缀 'api.client'开头的配置
@ConfigurationProperties("api.client")
public class ApiClientConfig {

    private String accessKey;
    private String secretKey;

    @Bean
    public ApiClient apiClient() {
        return new ApiClient(accessKey, secretKey);
    }
}
